<?php
/* @var $this ActivityController */
/* @var $model Activity */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'activity-form',
	'enableAjaxValidation'=>false,
)); 
$sate = $_GET['state'];
if($sate == 1){
?>
<p class="red"> <?php echo Yii::t('base','Not enough gift number');?> </p>
<?php } ?>
	<p class="note"><?php echo Yii::t('base','Fields with <span class="required">*</span> are required.');?></p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php //echo $form->labelEx($model,'classify_id'); ?>
		<!--Activity::model()->getActivityClassifyName('')-->
		<?php //echo $form->dropDownList($model,'classify_id',array('1'=>Yii::t('base','The full prize'),'2'=>Yii::t('base','Lucky draw'))); ?>
		<?php //echo $form->error($model,'classify_id'); ?>
		<?php echo $form->hiddenField($model,'classify_id',array('value'=>2))?>
	</div>
	
	<div class="row">
		<?php echo $form->label($model,'activity_code'); ?>
		<?php echo $form->textField($model,'activity_code',array('size'=>60,'maxlength'=>300)); ?>
		<?php echo $form->error($model,'activity_code'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>300)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'activity_time'); ?>
		<input class="Wdate" type="text" name="Activity[activity_time]" 
	 value="<?php echo $model->activity_time=='0000-00-00'?date("Y-m-d"):$model->activity_time;?>" onClick="WdatePicker({startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})" />
		<?php echo $form->error($model,'activity_time'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'provide_gift_number'); ?>
		<?php echo $form->textField($model,'provide_gift_number'); ?>
		<?php echo $form->error($model,'provide_gift_number'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'activity_out_time'); ?>
		<input class="Wdate" type="text" name="Activity[activity_out_time]" 
	 value="<?php echo $model->activity_out_time=='0000-00-00'?date("Y-m-d"):$model->activity_out_time;?>" onClick="WdatePicker({startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})" />
		<?php echo $form->error($model,'activity_out_time'); ?>
	</div>
	
	<div class="row">
		<?php //echo $form->labelEx($model,'address1'); ?>
		<?php //echo $form->dropDownList($model,'address1',Activity::model()->getAddressList(falg)); ?>
		<?php //echo $form->error($model,'address1'); ?>
	</div>
	
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('base','Create') : Yii::t('base','Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->